function(app name)
  add_executable(${name} ${ARGN})
  add_dependencies(apps ${name})
  target_link_libraries(${name} PRIVATE Galois::shmem lonestar)
  install(TARGETS ${name} DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT apps EXCLUDE_FROM_ALL)
endfunction()

app(example-sssp-push-simple SSSPPushSimple.cpp)
app(example-sssp-simple SSSPsimple.cpp)
app(example-sssp-pull-simple SSSPPullSimple.cpp)
app(example-hello-world HelloWorld.cpp)
app(example-torus Torus.cpp)
app(example-torus-improved TorusImproved.cpp)
app(example-torus-construction TorusConstruction.cpp)
app(example-graph-traversal-serial GraphTraversalSerial.cpp)
app(example-graph-traversal-pull GraphTraversalPullOperator.cpp)
app(example-graph-traversal-push GraphTraversalPushOperator.cpp)
app(example-conflict-aware-torus ConflictAwareTorus.cpp)
app(example-spanningtree SpanningTree.cpp)
app(example-countlevels CountLevels.cpp)
app(example-malloc ThirdPartyMalloc.cpp)
app(example-wrapped-worklist ExampleWrappedWorklist.cpp)

add_test_scale(small example-hello-world 2 10)
add_test_scale(small example-torus 2 100)
add_test_scale(small example-torus-improved 2 100)
add_test_scale(small1 example-spanningtree "${BASEINPUT}/reference/structured/rome99.gr")
add_test_scale(small2 example-spanningtree "${BASEINPUT}/scalefree/rmat10.gr")
